/*
 * @Date: 2025-09-24 17:08:06
 * @LastEditors: 吴世扬 18368095041@163.com
 * @LastEditTime: 2025-09-24 17:13:31
 * @FilePath: /vue3-admin/src/service/useEnum/modules/system.ts
 */
import {
    Subject,
    debounceTime,
    switchMap,
    from,
    shareReplay,
    map,
    Observable
} from 'rxjs';

import { readAllRoles } from '@/api/role';
import { readDeptTree } from '@/api/department';
import { readMenuTree } from '@/api/menu';

import { generateSource } from '../utils';

export const roleTypesSubject = new Subject();
export const roleTypesSource = generateSource(
    roleTypesSubject,
    readAllRoles,
    'name',
    'id'
);

export const deptTreeTypesSubject = new Subject();
export const deptTreeTypesSource = generateSource(
    deptTreeTypesSubject,
    readDeptTree,
    'name',
    'id'
);

export const menuTreeTypesSubject = new Subject();
export const menuTreeTypesSource = generateSource(
    menuTreeTypesSubject,
    readMenuTree,
    'name',
    'id'
);
